home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / PInterfaces / Drag.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  23.5 KB  |  620 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Drag.p
  3.  
  4.      Contains:    Drag and Drop Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1992-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT Drag;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __DRAG__}
  27. {$SETC __DRAG__ := 1}
  28.  
  29. {$I+}
  30. {$SETC DragIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __MACTYPES__}
  34. {$I MacTypes.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __EVENTS__}
  37. {$I Events.p}
  38. {$ENDC}
  39. {$IFC UNDEFINED __FILES__}
  40. {$I Files.p}
  41. {$ENDC}
  42. {$IFC UNDEFINED __APPLEEVENTS__}
  43. {$I AppleEvents.p}
  44. {$ENDC}
  45. {$IFC UNDEFINED __QUICKDRAW__}
  46. {$I Quickdraw.p}
  47. {$ENDC}
  48.  
  49.  
  50. {$PUSH}
  51. {$ALIGN MAC68K}
  52. {$LibExport+}
  53.  
  54. {
  55.   _________________________________________________________________________________________________________
  56.       
  57.    • DRAG MANAGER DATA TYPES
  58.   _________________________________________________________________________________________________________
  59. }
  60.  
  61.  
  62. TYPE
  63.     DragReference = ^LONGINT;
  64.     ItemReference                        = UInt32;
  65.     FlavorType                            = OSType;
  66. {
  67.   _________________________________________________________________________________________________________
  68.       
  69.    • DRAG ATTRIBUTES
  70.   _________________________________________________________________________________________________________
  71. }
  72.  
  73.     DragAttributes                        = OptionBits;
  74.  
  75. CONST
  76.     kDragHasLeftSenderWindow    = $00000001;                    {  drag has left the source window since TrackDrag }
  77.     kDragInsideSenderApplication = $00000002;                    {  drag is occurring within the sender application }
  78.     kDragInsideSenderWindow        = $00000004;                    {  drag is occurring within the sender window }
  79.  
  80. {
  81.   _________________________________________________________________________________________________________
  82.       
  83.    • DRAG IMAGE FLAGS
  84.   _________________________________________________________________________________________________________
  85. }
  86.  
  87.  
  88. TYPE
  89.     DragImageFlags                        = OptionBits;
  90.  
  91. CONST
  92.     kDragRegionAndImage            = $00000010;                    {  drag region and image }
  93.  
  94. {
  95.   _________________________________________________________________________________________________________
  96.       
  97.    • DRAG IMAGE TRANSLUCENCY LEVELS
  98.   _________________________________________________________________________________________________________
  99. }
  100.  
  101.     kDragStandardTranslucency    = 0;                            {  65% image translucency (standard) }
  102.     kDragDarkTranslucency        = 1;                            {  50% image translucency }
  103.     kDragDarkerTranslucency        = 2;                            {  25% image translucency }
  104.     kDragOpaqueTranslucency        = 3;                            {  0% image translucency (opaque) }
  105.  
  106. {
  107.   _________________________________________________________________________________________________________
  108.       
  109.    • DRAG DRAWING PROCEDURE MESSAGES
  110.   _________________________________________________________________________________________________________
  111. }
  112.  
  113.  
  114. TYPE
  115.     DragRegionMessage                    = SInt16;
  116.  
  117. CONST
  118.     kDragRegionBegin            = 1;                            {  initialize drawing }
  119.     kDragRegionDraw                = 2;                            {  draw drag feedback }
  120.     kDragRegionHide                = 3;                            {  hide drag feedback }
  121.     kDragRegionIdle                = 4;                            {  drag feedback idle time }
  122.     kDragRegionEnd                = 5;                            {  end of drawing }
  123.  
  124. {
  125.   _________________________________________________________________________________________________________
  126.       
  127.    • ZOOM ACCELERATION
  128.   _________________________________________________________________________________________________________
  129. }
  130.  
  131.  
  132. TYPE
  133.     ZoomAcceleration                    = SInt16;
  134.  
  135. CONST
  136.     kZoomNoAcceleration            = 0;                            {  use linear interpolation }
  137.     kZoomAccelerate                = 1;                            {  ramp up step size }
  138.     kZoomDecelerate                = 2;                            {  ramp down step size }
  139.  
  140. {
  141.   _________________________________________________________________________________________________________
  142.       
  143.    • FLAVOR FLAGS
  144.   _________________________________________________________________________________________________________
  145. }
  146.  
  147.  
  148. TYPE
  149.     FlavorFlags                            = OptionBits;
  150.  
  151. CONST
  152.     flavorSenderOnly            = $01;                            {  flavor is available to sender only }
  153.     flavorSenderTranslated        = $02;                            {  flavor is translated by sender }
  154.     flavorNotSaved                = $04;                            {  flavor should not be saved }
  155.     flavorSystemTranslated        = $0100;                        {  flavor is translated by system }
  156.  
  157. {
  158.   _________________________________________________________________________________________________________
  159.       
  160.    • SPECIAL FLAVORS
  161.   _________________________________________________________________________________________________________
  162. }
  163.  
  164.     flavorTypeHFS                = 'hfs ';                        {  flavor type for HFS data }
  165.     flavorTypePromiseHFS        = 'phfs';                        {  flavor type for promised HFS data }
  166.     flavorTypeDirectory            = 'diry';                        {  flavor type for AOCE directories }
  167.  
  168. {
  169.   _________________________________________________________________________________________________________
  170.       
  171.    • FLAVORS FOR FINDER 8.0 AND LATER
  172.   _________________________________________________________________________________________________________
  173. }
  174.  
  175.     kFlavorTypeClippingName        = 'clnm';                        {  name hint for clipping file (preferred over 'clfn') }
  176.     kFlavorTypeClippingFilename    = 'clfn';                        {  name for clipping file }
  177.     kFlavorTypeDragToTrashOnly    = 'fdtt';                        {  for apps that want to allow dragging private data to the trash }
  178.     kFlavorTypeFinderNoTrackingBehavior = 'fntb';                {  Finder completely ignores any drag containing this flavor }
  179.  
  180. {
  181.   _________________________________________________________________________________________________________
  182.       
  183.    • DRAG TRACKING HANDLER MESSAGES
  184.   _________________________________________________________________________________________________________
  185. }
  186.  
  187.  
  188. TYPE
  189.     DragTrackingMessage                    = SInt16;
  190.  
  191. CONST
  192.     kDragTrackingEnterHandler    = 1;                            {  drag has entered handler }
  193.     kDragTrackingEnterWindow    = 2;                            {  drag has entered window }
  194.     kDragTrackingInWindow        = 3;                            {  drag is moving within window }
  195.     kDragTrackingLeaveWindow    = 4;                            {  drag has exited window }
  196.     kDragTrackingLeaveHandler    = 5;                            {  drag has exited handler }
  197.  
  198. {
  199.   _________________________________________________________________________________________________________
  200.       
  201.    • HFS FLAVORS
  202.   _________________________________________________________________________________________________________
  203. }
  204.  
  205.  
  206. TYPE
  207.     HFSFlavorPtr = ^HFSFlavor;
  208.     HFSFlavor = RECORD
  209.         fileType:                OSType;                                    {  file type  }
  210.         fileCreator:            OSType;                                    {  file creator  }
  211.         fdFlags:                UInt16;                                    {  Finder flags  }
  212.         fileSpec:                FSSpec;                                    {  file system specification  }
  213.     END;
  214.  
  215.     PromiseHFSFlavorPtr = ^PromiseHFSFlavor;
  216.     PromiseHFSFlavor = RECORD
  217.         fileType:                OSType;                                    {  file type  }
  218.         fileCreator:            OSType;                                    {  file creator  }
  219.         fdFlags:                UInt16;                                    {  Finder flags  }
  220.         promisedFlavor:            FlavorType;                                {  promised flavor containing an FSSpec  }
  221.     END;
  222.  
  223. {
  224.   _________________________________________________________________________________________________________
  225.       
  226.    • APPLICATION-DEFINED DRAG HANDLER ROUTINES
  227.   _________________________________________________________________________________________________________
  228. }
  229. {$IFC TYPED_FUNCTION_POINTERS}
  230.     DragTrackingHandlerProcPtr = FUNCTION(message: DragTrackingMessage; theWindow: WindowPtr; handlerRefCon: UNIV Ptr; theDrag: DragReference): OSErr;
  231. {$ELSEC}
  232.     DragTrackingHandlerProcPtr = ProcPtr;
  233. {$ENDC}
  234.  
  235. {$IFC TYPED_FUNCTION_POINTERS}
  236.     DragReceiveHandlerProcPtr = FUNCTION(theWindow: WindowPtr; handlerRefCon: UNIV Ptr; theDrag: DragReference): OSErr;
  237. {$ELSEC}
  238.     DragReceiveHandlerProcPtr = ProcPtr;
  239. {$ENDC}
  240.  
  241.     DragTrackingHandlerUPP = UniversalProcPtr;
  242.     DragReceiveHandlerUPP = UniversalProcPtr;
  243.  
  244. CONST
  245.     uppDragTrackingHandlerProcInfo = $00003FA0;
  246.     uppDragReceiveHandlerProcInfo = $00000FE0;
  247.  
  248. FUNCTION NewDragTrackingHandlerProc(userRoutine: DragTrackingHandlerProcPtr): DragTrackingHandlerUPP;
  249.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  250.     INLINE $2E9F;
  251.     {$ENDC}
  252.  
  253. FUNCTION NewDragReceiveHandlerProc(userRoutine: DragReceiveHandlerProcPtr): DragReceiveHandlerUPP;
  254.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  255.     INLINE $2E9F;
  256.     {$ENDC}
  257.  
  258. FUNCTION CallDragTrackingHandlerProc(message: DragTrackingMessage; theWindow: WindowPtr; handlerRefCon: UNIV Ptr; theDrag: DragReference; userRoutine: DragTrackingHandlerUPP): OSErr;
  259.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  260.     INLINE $205F, $4E90;
  261.     {$ENDC}
  262.  
  263. FUNCTION CallDragReceiveHandlerProc(theWindow: WindowPtr; handlerRefCon: UNIV Ptr; theDrag: DragReference; userRoutine: DragReceiveHandlerUPP): OSErr;
  264.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  265.     INLINE $205F, $4E90;
  266.     {$ENDC}
  267. {
  268.   _________________________________________________________________________________________________________
  269.       
  270.    • APPLICATION-DEFINED ROUTINES
  271.   _________________________________________________________________________________________________________
  272. }
  273.  
  274. TYPE
  275. {$IFC TYPED_FUNCTION_POINTERS}
  276.     DragSendDataProcPtr = FUNCTION(theType: FlavorType; dragSendRefCon: UNIV Ptr; theItemRef: ItemReference; theDrag: DragReference): OSErr;
  277. {$ELSEC}
  278.     DragSendDataProcPtr = ProcPtr;
  279. {$ENDC}
  280.  
  281. {$IFC TYPED_FUNCTION_POINTERS}
  282.     DragInputProcPtr = FUNCTION(VAR mouse: Point; VAR modifiers: SInt16; dragInputRefCon: UNIV Ptr; theDrag: DragReference): OSErr;
  283. {$ELSEC}
  284.     DragInputProcPtr = ProcPtr;
  285. {$ENDC}
  286.  
  287. {$IFC TYPED_FUNCTION_POINTERS}
  288.     DragDrawingProcPtr = FUNCTION(message: DragRegionMessage; showRegion: RgnHandle; showOrigin: Point; hideRegion: RgnHandle; hideOrigin: Point; dragDrawingRefCon: UNIV Ptr; theDrag: DragReference): OSErr;
  289. {$ELSEC}
  290.     DragDrawingProcPtr = ProcPtr;
  291. {$ENDC}
  292.  
  293.     DragSendDataUPP = UniversalProcPtr;
  294.     DragInputUPP = UniversalProcPtr;
  295.     DragDrawingUPP = UniversalProcPtr;
  296.  
  297. CONST
  298.     uppDragSendDataProcInfo = $00003FE0;
  299.     uppDragInputProcInfo = $00003FE0;
  300.     uppDragDrawingProcInfo = $000FFFA0;
  301.  
  302. FUNCTION NewDragSendDataProc(userRoutine: DragSendDataProcPtr): DragSendDataUPP;
  303.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  304.     INLINE $2E9F;
  305.     {$ENDC}
  306.  
  307. FUNCTION NewDragInputProc(userRoutine: DragInputProcPtr): DragInputUPP;
  308.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  309.     INLINE $2E9F;
  310.     {$ENDC}
  311.  
  312. FUNCTION NewDragDrawingProc(userRoutine: DragDrawingProcPtr): DragDrawingUPP;
  313.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  314.     INLINE $2E9F;
  315.     {$ENDC}
  316.  
  317. FUNCTION CallDragSendDataProc(theType: FlavorType; dragSendRefCon: UNIV Ptr; theItemRef: ItemReference; theDrag: DragReference; userRoutine: DragSendDataUPP): OSErr;
  318.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  319.     INLINE $205F, $4E90;
  320.     {$ENDC}
  321.  
  322. FUNCTION CallDragInputProc(VAR mouse: Point; VAR modifiers: SInt16; dragInputRefCon: UNIV Ptr; theDrag: DragReference; userRoutine: DragInputUPP): OSErr;
  323.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  324.     INLINE $205F, $4E90;
  325.     {$ENDC}
  326.  
  327. FUNCTION CallDragDrawingProc(message: DragRegionMessage; showRegion: RgnHandle; showOrigin: Point; hideRegion: RgnHandle; hideOrigin: Point; dragDrawingRefCon: UNIV Ptr; theDrag: DragReference; userRoutine: DragDrawingUPP): OSErr;
  328.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  329.     INLINE $205F, $4E90;
  330.     {$ENDC}
  331. {
  332.   _________________________________________________________________________________________________________
  333.       
  334.    • INSTALLING AND REMOVING HANDLERS API'S
  335.   _________________________________________________________________________________________________________
  336. }
  337.  
  338. FUNCTION InstallTrackingHandler(trackingHandler: DragTrackingHandlerUPP; theWindow: WindowPtr; handlerRefCon: UNIV Ptr): OSErr;
  339.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  340.     INLINE $7001, $ABED;
  341.     {$ENDC}
  342. FUNCTION InstallReceiveHandler(receiveHandler: DragReceiveHandlerUPP; theWindow: WindowPtr; handlerRefCon: UNIV Ptr): OSErr;
  343.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  344.     INLINE $7002, $ABED;
  345.     {$ENDC}
  346. FUNCTION RemoveTrackingHandler(trackingHandler: DragTrackingHandlerUPP; theWindow: WindowPtr): OSErr;
  347.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  348.     INLINE $7003, $ABED;
  349.     {$ENDC}
  350. FUNCTION RemoveReceiveHandler(receiveHandler: DragReceiveHandlerUPP; theWindow: WindowPtr): OSErr;
  351.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  352.     INLINE $7004, $ABED;
  353.     {$ENDC}
  354. {
  355.   _________________________________________________________________________________________________________
  356.       
  357.    • CREATING & DISPOSING
  358.   _________________________________________________________________________________________________________
  359. }
  360.  
  361. FUNCTION NewDrag(VAR theDrag: DragReference): OSErr;
  362.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  363.     INLINE $7005, $ABED;
  364.     {$ENDC}
  365. FUNCTION DisposeDrag(theDrag: DragReference): OSErr;
  366.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  367.     INLINE $7006, $ABED;
  368.     {$ENDC}
  369. {
  370.   _________________________________________________________________________________________________________
  371.       
  372.    • ADDING DRAG ITEM FLAVORS
  373.   _________________________________________________________________________________________________________
  374. }
  375.  
  376. FUNCTION AddDragItemFlavor(theDrag: DragReference; theItemRef: ItemReference; theType: FlavorType; dataPtr: UNIV Ptr; dataSize: Size; theFlags: FlavorFlags): OSErr;
  377.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  378.     INLINE $7007, $ABED;
  379.     {$ENDC}
  380. FUNCTION SetDragItemFlavorData(theDrag: DragReference; theItemRef: ItemReference; theType: FlavorType; dataPtr: UNIV Ptr; dataSize: Size; dataOffset: UInt32): OSErr;
  381.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  382.     INLINE $7009, $ABED;
  383.     {$ENDC}
  384. {
  385.   _________________________________________________________________________________________________________
  386.       
  387.    • PROVIDING CALLBACK PROCEDURES
  388.   _________________________________________________________________________________________________________
  389. }
  390.  
  391. FUNCTION SetDragSendProc(theDrag: DragReference; sendProc: DragSendDataUPP; dragSendRefCon: UNIV Ptr): OSErr;
  392.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  393.     INLINE $700A, $ABED;
  394.     {$ENDC}
  395.  
  396. FUNCTION SetDragInputProc(theDrag: DragReference; inputProc: DragInputUPP; dragInputRefCon: UNIV Ptr): OSErr;
  397.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  398.     INLINE $700B, $ABED;
  399.     {$ENDC}
  400. FUNCTION SetDragDrawingProc(theDrag: DragReference; drawingProc: DragDrawingUPP; dragDrawingRefCon: UNIV Ptr): OSErr;
  401.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  402.     INLINE $700C, $ABED;
  403.     {$ENDC}
  404. {
  405.   _________________________________________________________________________________________________________
  406.       
  407.    • SETTING THE DRAG IMAGE
  408.   _________________________________________________________________________________________________________
  409. }
  410.  
  411. FUNCTION SetDragImage(theDrag: DragReference; imagePixMap: PixMapHandle; imageRgn: RgnHandle; imageOffsetPt: Point; theImageFlags: DragImageFlags): OSErr;
  412.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  413.     INLINE $7027, $ABED;
  414.     {$ENDC}
  415. {
  416.   _________________________________________________________________________________________________________
  417.       
  418.    • PERFORMING A DRAG
  419.   _________________________________________________________________________________________________________
  420. }
  421.  
  422. FUNCTION TrackDrag(theDrag: DragReference; {CONST}VAR theEvent: EventRecord; theRegion: RgnHandle): OSErr;
  423.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  424.     INLINE $700D, $ABED;
  425.     {$ENDC}
  426. {
  427.   _________________________________________________________________________________________________________
  428.       
  429.    • GETTING DRAG ITEM INFORMATION
  430.   _________________________________________________________________________________________________________
  431. }
  432.  
  433. FUNCTION CountDragItems(theDrag: DragReference; VAR numItems: UInt16): OSErr;
  434.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  435.     INLINE $700E, $ABED;
  436.     {$ENDC}
  437. FUNCTION GetDragItemReferenceNumber(theDrag: DragReference; index: UInt16; VAR theItemRef: ItemReference): OSErr;
  438.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  439.     INLINE $700F, $ABED;
  440.     {$ENDC}
  441. FUNCTION CountDragItemFlavors(theDrag: DragReference; theItemRef: ItemReference; VAR numFlavors: UInt16): OSErr;
  442.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  443.     INLINE $7010, $ABED;
  444.     {$ENDC}
  445. FUNCTION GetFlavorType(theDrag: DragReference; theItemRef: ItemReference; index: UInt16; VAR theType: FlavorType): OSErr;
  446.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  447.     INLINE $7011, $ABED;
  448.     {$ENDC}
  449. FUNCTION GetFlavorFlags(theDrag: DragReference; theItemRef: ItemReference; theType: FlavorType; VAR theFlags: FlavorFlags): OSErr;
  450.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  451.     INLINE $7012, $ABED;
  452.     {$ENDC}
  453. FUNCTION GetFlavorDataSize(theDrag: DragReference; theItemRef: ItemReference; theType: FlavorType; VAR dataSize: Size): OSErr;
  454.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  455.     INLINE $7013, $ABED;
  456.     {$ENDC}
  457. FUNCTION GetFlavorData(theDrag: DragReference; theItemRef: ItemReference; theType: FlavorType; dataPtr: UNIV Ptr; VAR dataSize: Size; dataOffset: UInt32): OSErr;
  458.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  459.     INLINE $7014, $ABED;
  460.     {$ENDC}
  461. {
  462.   _________________________________________________________________________________________________________
  463.       
  464.    • DRAG ITEM BOUNDS
  465.   _________________________________________________________________________________________________________
  466. }
  467.  
  468. FUNCTION GetDragItemBounds(theDrag: DragReference; theItemRef: ItemReference; VAR itemBounds: Rect): OSErr;
  469.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  470.     INLINE $7015, $ABED;
  471.     {$ENDC}
  472. FUNCTION SetDragItemBounds(theDrag: DragReference; theItemRef: ItemReference; {CONST}VAR itemBounds: Rect): OSErr;
  473.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  474.     INLINE $7016, $ABED;
  475.     {$ENDC}
  476. {
  477.   _________________________________________________________________________________________________________
  478.       
  479.    • DROP LOCATIONS
  480.   _________________________________________________________________________________________________________
  481. }
  482.  
  483. FUNCTION GetDropLocation(theDrag: DragReference; VAR dropLocation: AEDesc): OSErr;
  484.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  485.     INLINE $7017, $ABED;
  486.     {$ENDC}
  487. FUNCTION SetDropLocation(theDrag: DragReference; {CONST}VAR dropLocation: AEDesc): OSErr;
  488.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  489.     INLINE $7018, $ABED;
  490.     {$ENDC}
  491. {
  492.   _________________________________________________________________________________________________________
  493.       
  494.    • GETTING INFORMATION ABOUT A DRAG
  495.   _________________________________________________________________________________________________________
  496. }
  497.  
  498. FUNCTION GetDragAttributes(theDrag: DragReference; VAR flags: DragAttributes): OSErr;
  499.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  500.     INLINE $7019, $ABED;
  501.     {$ENDC}
  502. FUNCTION GetDragMouse(theDrag: DragReference; VAR mouse: Point; VAR globalPinnedMouse: Point): OSErr;
  503.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  504.     INLINE $701A, $ABED;
  505.     {$ENDC}
  506. FUNCTION SetDragMouse(theDrag: DragReference; globalPinnedMouse: Point): OSErr;
  507.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  508.     INLINE $701B, $ABED;
  509.     {$ENDC}
  510. FUNCTION GetDragOrigin(theDrag: DragReference; VAR globalInitialMouse: Point): OSErr;
  511.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  512.     INLINE $701C, $ABED;
  513.     {$ENDC}
  514. FUNCTION GetDragModifiers(theDrag: DragReference; VAR modifiers: SInt16; VAR mouseDownModifiers: SInt16; VAR mouseUpModifiers: SInt16): OSErr;
  515.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  516.     INLINE $701D, $ABED;
  517.     {$ENDC}
  518. {
  519.   _________________________________________________________________________________________________________
  520.       
  521.    • DRAG HIGHLIGHTING
  522.   _________________________________________________________________________________________________________
  523. }
  524.  
  525. FUNCTION ShowDragHilite(theDrag: DragReference; hiliteFrame: RgnHandle; inside: BOOLEAN): OSErr;
  526.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  527.     INLINE $701E, $ABED;
  528.     {$ENDC}
  529. FUNCTION HideDragHilite(theDrag: DragReference): OSErr;
  530.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  531.     INLINE $701F, $ABED;
  532.     {$ENDC}
  533. FUNCTION DragPreScroll(theDrag: DragReference; dH: SInt16; dV: SInt16): OSErr;
  534.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  535.     INLINE $7020, $ABED;
  536.     {$ENDC}
  537. FUNCTION DragPostScroll(theDrag: DragReference): OSErr;
  538.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  539.     INLINE $7021, $ABED;
  540.     {$ENDC}
  541. FUNCTION UpdateDragHilite(theDrag: DragReference; updateRgn: RgnHandle): OSErr;
  542.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  543.     INLINE $7022, $ABED;
  544.     {$ENDC}
  545. FUNCTION GetDragHiliteColor(window: WindowPtr; VAR color: RGBColor): OSErr;
  546.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  547.     INLINE $7026, $ABED;
  548.     {$ENDC}
  549.  
  550. {
  551.   _________________________________________________________________________________________________________
  552.       
  553.    • UTILITIES
  554.   _________________________________________________________________________________________________________
  555. }
  556.  
  557.  
  558. FUNCTION WaitMouseMoved(initialMouse: Point): BOOLEAN;
  559.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  560.     INLINE $7023, $ABED;
  561.     {$ENDC}
  562.  
  563. FUNCTION ZoomRects({CONST}VAR fromRect: Rect; {CONST}VAR toRect: Rect; zoomSteps: SInt16; acceleration: ZoomAcceleration): OSErr;
  564.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  565.     INLINE $7024, $ABED;
  566.     {$ENDC}
  567. FUNCTION ZoomRegion(region: RgnHandle; zoomDistance: Point; zoomSteps: SInt16; acceleration: ZoomAcceleration): OSErr;
  568.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  569.     INLINE $7025, $ABED;
  570.     {$ENDC}
  571.  
  572. {
  573.   _________________________________________________________________________________________________________
  574.    • OLD NAMES
  575.      These are provided for compatiblity with older source bases.  It is recommended to not use them since
  576.        they may removed from this interface file at any time.
  577.   _________________________________________________________________________________________________________
  578. }
  579.  
  580. {$IFC OLDROUTINENAMES }
  581.  
  582. CONST
  583.     dragHasLeftSenderWindow        = $00000001;                    {  drag has left the source window since TrackDrag  }
  584.     dragInsideSenderApplication    = $00000002;                    {  drag is occurring within the sender application  }
  585.     dragInsideSenderWindow        = $00000004;                    {  drag is occurring within the sender window  }
  586.  
  587.     dragTrackingEnterHandler    = 1;                            {  drag has entered handler  }
  588.     dragTrackingEnterWindow        = 2;                            {  drag has entered window  }
  589.     dragTrackingInWindow        = 3;                            {  drag is moving within window  }
  590.     dragTrackingLeaveWindow        = 4;                            {  drag has exited window  }
  591.     dragTrackingLeaveHandler    = 5;                            {  drag has exited handler  }
  592.  
  593.     dragRegionBegin                = 1;                            {  initialize drawing  }
  594.     dragRegionDraw                = 2;                            {  draw drag feedback  }
  595.     dragRegionHide                = 3;                            {  hide drag feedback  }
  596.     dragRegionIdle                = 4;                            {  drag feedback idle time  }
  597.     dragRegionEnd                = 5;                            {  end of drawing  }
  598.  
  599.     zoomNoAcceleration            = 0;                            {  use linear interpolation  }
  600.     zoomAccelerate                = 1;                            {  ramp up step size  }
  601.     zoomDecelerate                = 2;                            {  ramp down step size  }
  602.  
  603.     kDragStandardImage            = 0;                            {  65% image translucency (standard) }
  604.     kDragDarkImage                = 1;                            {  50% image translucency }
  605.     kDragDarkerImage            = 2;                            {  25% image translucency }
  606.     kDragOpaqueImage            = 3;                            {  0% image translucency (opaque) }
  607.  
  608. {$ENDC}  {OLDROUTINENAMES}
  609.  
  610. {$ALIGN RESET}
  611. {$POP}
  612.  
  613. {$SETC UsingIncludes := DragIncludes}
  614.  
  615. {$ENDC} {__DRAG__}
  616.  
  617. {$IFC NOT UsingIncludes}
  618.  END.
  619. {$ENDC}
  620.